﻿<UserControl x:Class="WowModelExplorer.Controls.Animation.AnimationView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:anim="clr-namespace:WowModelExplorer.Controls.Animation"
             xmlns:cmd="clr-namespace:WowModelExplorer.Commands"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <UserControl.InputBindings>
        <KeyBinding Key="F1" Command="cmd:AnimationCommands.Play" />
        <KeyBinding Key="F2" Command="cmd:AnimationCommands.Step" />
        <KeyBinding Key="F3" Command="cmd:AnimationCommands.Pause" />
        <KeyBinding Key="F4" Command="cmd:AnimationCommands.Stop" />
    </UserControl.InputBindings>
    <Grid>
        <Grid.Resources>
            <Style x:Key="{x:Type ListBoxItem}" TargetType="ListBoxItem">
                <Setter Property="SnapsToDevicePixels" Value="true" />
                <Setter Property="OverridesDefaultStyle" Value="true" />
                <Setter Property="Height" Value="18" />
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="ListBoxItem">
                            <Border Name="PART_Border" BorderThickness="1,1,1,1">
                                <ContentPresenter Name="Content" />
                            </Border>
                            <ControlTemplate.Triggers>
                                <Trigger Property="IsSelected" Value="true">
                                    <Setter TargetName="PART_Border" Property="Background" Value="{StaticResource SelectedBackgroundBrush}" />
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
        </Grid.Resources>
        <Grid.RowDefinitions>
            <RowDefinition Height="23"/>
            <RowDefinition Height="23"/>
            <RowDefinition />
            <RowDefinition Height="18"/>
        </Grid.RowDefinitions>
        <Grid>
            <anim:AnimationToolbar x:Name="_animationToolbar"/>
        </Grid>
        <Border Grid.Row="1" BorderBrush="{DynamicResource EdgeBorderBrush}" BorderThickness="0,1,0,1">
            <anim:AnimationHeader x:Name="_animationHeader"/>
        </Border>
        <ListBox Name="_animationList"
                 Grid.Row="2"
                 ScrollViewer.HorizontalScrollBarVisibility="Disabled">
        </ListBox>
        <ScrollBar Name="_scrollbar"
                   Grid.Row="3"
                   Orientation="Horizontal"
                   ViewportSize="{Binding ElementName=_animationList,
                                          Path=ActualWidth}" />
    </Grid>
</UserControl>
